﻿using BUGCOME.Model.Common;
using BUGCOME.Model.Common.dto;

namespace BUGCOME.Service.Common.IServices
{
    /// <summary>
    /// 系统字典服务接口（异步完整版）
    /// </summary>
    public interface IDictTypeService
    {
        /// <summary>
        /// 获取所有字典类型（异步）
        /// </summary>
        /// <returns>字典类型列表</returns>
        Task<List<DictType>> GetAllAsync();

        /// <summary>
        /// 分页查询字典类型列表（异步）
        /// </summary>
        /// <param name="dict">查询条件</param>
        /// <returns>分页结果</returns>
        Task<PagedInfo<DictType>> SelectDictTypeListAsync(DictTypeQueryDto dict);

        /// <summary>
        /// 校验字典类型是否唯一（异步）
        /// </summary>
        /// <param name="dictType">字典类型实体</param>
        /// <returns>唯一状态（UserConstants.UNIQUE/USERConstants.NOT_UNIQUE）</returns>
        Task<string> CheckDictTypeUniqueAsync(DictType dictType);

        /// <summary>
        /// 批量删除字典类型（异步）
        /// </summary>
        /// <param name="dictIds">字典ID数组</param>
        /// <returns>删除成功的数量</returns>
        Task<int> DeleteDictTypeByIdsAsync(long[] dictIds);

        /// <summary>
        /// 插入字典类型（异步）
        /// </summary>
        /// <param name="dictType">字典类型实体</param>
        /// <returns>新增字典的主键ID</returns>
        Task<long> InsertDictTypeAsync(DictType dictType);

        /// <summary>
        /// 修改字典类型（异步）
        /// </summary>
        /// <param name="dictType">字典类型实体</param>
        /// <returns>修改成功的数量</returns>
        Task<int> UpdateDictTypeAsync(DictType dictType);

        /// <summary>
        /// 根据ID获取字典类型详情（异步）
        /// </summary>
        /// <param name="dictId">字典ID</param>
        /// <returns>字典类型实体</returns>
        Task<DictType> GetInfoAsync(long dictId);


        /// <summary>根据自定义SQL查询字典数据</summary>
        /// <param name="dictType">字典类型</param>
        /// <returns>字典数据集合</returns>
        Task<List<DictData>> SelectDictDataByCustomSqlAsync(string dictType);
        
    }
}